package com.yserp.api.orderapi;

import java.util.Date;
import java.util.List;
import java.util.UUID;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.yserp.api.baseapi.erpController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.basecode.server.common.constants.DictConst;
import cn.basecode.server.common.constants.ResCode;
import cn.basecode.server.common.vo.ResultDO;
import cn.basecode.server.common.vo.SysDictBean;


/**
 * @author: sumj
 * @date: 2014年12月12日 下午3:14:17
 */
//@Controller
//@RequestMapping(value = "/client")
public class ClientStoreApi extends erpController {
	

	/**
	 * <p>请求商品分类.</p>  
	 */
	@RequestMapping(value = "/dict/getDictByCode", method = RequestMethod.POST)
	@ResponseBody
	private ResultDO<?> getDictByCode(String dictCode,HttpServletRequest request,HttpServletResponse response,HttpSession session) {
		try {
			List<SysDictBean> list = DictConst.getDictListByTypeCode(dictCode);
			return new ResultDO<List<SysDictBean>>(list);
		}catch (Exception e) {
			e.printStackTrace();
			return toErrorResult(ResCode.COM_EXCEPTION.getResCode(),"数据错误!");
		}
	}
	
//	/**
//	 * <p>请求商品分类.</p>
//	 */
//	@RequestMapping(value = "/store/createSotre", method = RequestMethod.POST)
//	@ResponseBody
//	private ResultDO<?> createSotre(TStoreInfoBean bean) {
//		try {
////			List<SysDictBean> list = DictConst.getDictListByTypeCode(dictCode);
////			return new ResultDO<List<SysDictBean>>(list);
//			bean.setStoreId(UUID.randomUUID().toString());
//			bean.setCreateTime(new Date());
//			bean.setDelFlag(1);
//			return storeHouseService.addStore(bean);
//		}catch (Exception e) {
//			e.printStackTrace();
//			return toErrorResult(ResCode.COM_EXCEPTION.getResCode(),"添加仓库失败!");
//		}
//	}
}
